package com.easy.admin.system.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class LoginConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器
        InterceptorRegistration registration = registry.addInterceptor(new LoginAdminInterceptor());
        registration.addPathPatterns("/**");
        registration.excludePathPatterns(
                "/login",//登录
                "/register",//注册
                "/Wxlogin",//微信登录
                "/loginForm",//登录表单提交
                "/sendRegisterCode",//注册验证码
                "/grabSingle",//分享页面
                "/registerForm",//注册表单提价
                "/sendFindPasswordCode",//发送验证码
                "/forgetPasswordForm",//修改密码
                "/rules",//规则
                "/forgetPassword",//忘记密码
                "/forgetPasswordForm",//忘记密码表单提交
                "/wexinShiro",//微信授权
                "/createMenu",//给公众号添加菜单接口
                "/**/*.html",            //html静态资源
                "/**/*.js",              //js静态资源
                "/**/*.css",             //css静态资源
                "/**/*.woff",
                "/**/*.ttf",
                "/**/*.png",
                "/**/*.jpg"
        );
    }

}
